using Distributed

function putter(c::Channel)
    println("putting...")
    for i = 1:5
        put!(c, i)
    end
    println("closing...")
    sleep(1)
    close(c)
    println("put over.")
end

function taker(c::Channel)
    println("taking...")
    for x in c
      print(x, " ")
    end
    println("all is taken.")
end


c = Channel(2)

 @async taker(c)
 @async putter(c)

 read(stdin, Char)
